﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcDeviceManager.Models
{
    public class Menu
    {
        public string MenuId { set; get; }
        public string MenuName { set; get; }
        public string Url { set; get; }
        public string ParentId { set; get; }
        public IList<Menu> Children { set; get; }
        public override int GetHashCode()
        {
            return -MenuId.GetHashCode();
        }
        public override bool Equals(Object obj)
        {
            if (obj == null)
            {
                return false;
            }
            if ((obj.GetType().Equals(this.GetType())) == false)
            {
                return false;
            }

            Menu temp = null;
            temp = (Menu)obj;
            if (temp.MenuId == null)
            {
                return false;
            }

            return temp.MenuId.Equals(MenuId);
        }
    }
}